layui.extend({
	roleMock: "mock/role",
}).define(["roleMock", "BaseServices", "apiRole", "utils"], function (exports) {
	var BaseServices = layui.BaseServices,
		roleMock = layui.roleMock,
		apiModule = layui.apiRole,
		utils = layui.utils;
	roleMock();

	function RoleServices(apiModule) {
		BaseServices.apply(this, arguments);
	}

	utils.inheritPrototype(RoleServices, BaseServices);

	/**
	 * @author: ares
	 * @date: 2021/4/28 11:23
	 * @description: 启用|禁用角色
	 * @param {string}roleId   角色id
	 * @param {boolean}disabled 时候禁用
	 */
	RoleServices.prototype.disable = function (roleId, disabled) {
		var params = {
			roleId: roleId,
			disabled: disabled
		};
		return this.service(this.apiModule.api.disable, {method: 'put', params: params});
	}

	exports("roleServices", new RoleServices(apiModule));
});
